]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
osdWindow: Fix blurry level bar
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 1 Jul 2016 16:54:03 +0000 (18:54 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 5 Jul 2016 18:41:13 +0000 (20:41 +0200)
ClutterActor:width is a floating point property, so it will not be
automatically rounded to non-fractional values that properly align
to pixels. To fix the resulting blurriness, add explicit rounding.

https://bugzilla.gnome.org/show_bug.cgi?id=768317

js/ui/osdWindow.js

index c33e937755fdc41378e2b9c2198cfc448145d1e4..4fd0c18f206c66c05b054d387e9c5b776668a3c0 100644 (file)
@@ -39,7 +39,7 @@ const LevelBar = new Lang.Class({
         this._level = Math.max(0, Math.min(value, 100));
 
         let alloc = this.actor.get_allocation_box();
-        let newWidth = (alloc.x2 - alloc.x1) * this._level / 100;
+        let newWidth = Math.round((alloc.x2 - alloc.x1) * this._level / 100);
         if (newWidth != this._bar.width)
             this._bar.width = newWidth;
     }